<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>确认订单</title>
    <link rel="stylesheet" href="/stylesheets/xiuxiu.css">
</head>
<body style="background-color: #f0f0f0">
<%include nav.html%>
<!--<div class="order_container">-->
<div style="height: 50px"></div>
    <div class="order_content" >
        <nav class="jy_nav">
            确认订单信息
        </nav>
        <%
        for(var i in order){
        %>
        <form  class="del-order"  role="form" method="post">
            <!--<div class="order_list_con" id="order_show">-->
                <div class="order_list">
                    <div class="order_header">
                        <div class="order_number">订单号：
                            <input type="text" value="<%=order[i].orderno%>" name="orderno">
                            <input type="text" value="<%=order[i].needsno%>" hidden name="needsno"><br>
                        </div>
                        <div class="trading_time">交易时间:<%=order[i].dealdate%></div>
                    </div>
                    <div class="order_service">
                        <div class="order_service_list">商品图片</div>
                        <div class="order_service_list">商家名称</div>
                        <div class="order_service_list">价格</div>
                        <div class="order_service_list">小计</div>
                    </div>
                    <div class="order_service">
                        <div class="order_service_list"><img src="/pets/<%=order[i].varietieno%>.jpg" alt=""></div>
                        <div class="order_service_list"><%=order[i].shop_name%></div>
                        <div class="order_service_list"><%=order[i].price%>元</div>
                        <div class="order_service_list"><%=order[i].price%>元</div>
                    </div>
                </div>
            <!--</div>-->
            <div class="confirm_info">
                总金额：<%=order[i].price%>元
            </div>
            <div class="confirm_info">
                <a href="/users/buy/count" onclick="apply()" ><button class="btn_submit">去支付</button></a>
                <div class="modal_address" id="modal_apply">
                    <div class="modal_inner">
                        <div class="modal_header">
                            <div class="header_info">支付宝</div>
                            <div class="header_close" >
                                <a href="" onclick="apply()">
                                    <img src="/images/close.png" alt="">
                                </a>
                            </div>
                        </div>
                        <div class="modal_content">
                            <form action="">
                                <div class="modal_row">
                                    <div class="modal_col1">支付金额:</div>
                                    <div class="modal_col2">
                                        <%=order[i].price%>元
                                    </div>
                                </div>
                                <div class="modal_row">
                                    <div class="modal_col1">支付密码:</div>
                                    <div class="modal_col2">
                                        <input type="password" required>
                                    </div>
                                </div>
                                <div class="modal_row">
                                    <div class="modal_col1">&nbsp;</div>
                                    <div class="modal_col2">
                                        <a href="/users/myorder"><button type="button" class="btn_submit">支付</button></a>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </form>
        <%
        break;
        }%>
    </div>
<div style="height: 50px"></div>
<!--</div>-->
<%include footer.html%>
<!--<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>-->
<script src="/js/jquery-1.8.3.js"></script>
<script>
    $('.del-order').submit(function () {
        $.ajax({
            type: 'POST',
            url: 'order/del',
            data:$(this).serialize(),
            dataType:'json',
            success: function (data) {
                if(data.res=="1"){
                    location.href='/order';
                }
            },
            error: function (data) {
                alert(data);
            }
        });
        return false;
    })
</script>

<script>
    function apply(){
        var e2 = document.getElementById('modal_apply');
        e2.style.visibility =  (e2.style.visibility == "visible"  ) ? "hidden" : "visible";
    }
</script>
</body>
</html>